﻿<div class="modal-form">
    @using (Html.BeginForm("Register", "Account", new RouteValueDictionary { { "ReturnUrl", Request.Url.OriginalString } }, FormMethod.Post, new Dictionary<string, object> { { "data-bind", "validationOptions: { insertMessages: false }, css: {error : rVM.isError}" }, { "class", "wait" } }))
    {
        @Html.AntiForgeryToken()
        <input class="input" placeholder="логин" id="UserName" name="UserName" type="text" value="" data-bind="val: rVM.UserName" />
        <input class="input" placeholder="пароль" id="Password" name="Password" type="password" data-bind="val: rVM.Password" />
        <input class="input" placeholder="повторите пароль" id="ConfirmPassword" name="ConfirmPassword" type="password" data-bind="val: rVM.ConfirmPassword" />
        <!-- <input class="input" placeholder="e-mail (не обязательно)" id="Email" name="Email" type="email" />-->
        <div class="status">
            <div class="error">
                <i class="icon icon-error"></i><span data-bind="validationMessage: rVM.Password"></span>
                <span data-bind="validationMessage: rVM.ConfirmPassword"></span>
                <span data-bind="text: rVM.errorMessage"></span>
            </div>
            <div class="submit button">зарегистрироваться</div>
        </div>
        @Html.ValidationSummary()
    }
    @using (Html.BeginForm("ExternalLogin", "Account", new { ReturnUrl = Request.Url.OriginalString }, FormMethod.Post, new { @class = "social", id = "socialLogin" }))
    {
        @Html.AntiForgeryToken()
        <input id="provider" type="hidden" name="provider" value="" />
        <div class="social-text">Так же вы можете войти используя следующие сайты:</div>
        <ul class="social-icons">
            <!--<li><a href="#" onclick="var prov = 'socialLogin('Vkontakte');"><i class="icon icon-vk"></i></a></li>
            <li><a href="#" onclick="socialLogin('Facebook')"><i class="icon icon-fb"></i></a></li>
            <li><a href="#" onclick="socialLogin('Twitter')"><i class="icon icon-tw"></i></a></li>-->
            <li><a href="#" onclick="socialLogin('Google')"><i class="icon icon-g"></i></a></li>
        </ul>
        <script type="text/javascript">
            function socialLogin(provider) {
                document.getElementById('provider').value = provider;
                document.getElementById('socialLogin').submit()
            }
        </script>
    }
</div>
